const router =require('express').Router();

const USER=require('../mock/user.js');

router.put('/refreshToken',(req,res)=>{
    let {refresh_token:token}=req.body;
    console.log('refresh_token:',token);

    if(token==USER.refresh_token){
        res.send({
            code:0,
            data:{
                access_token:USER.access_token,
                refresh_token:USER.refresh_token,
                expires_in:USER.expires_in
            }
        });
    }else{
        res.send({
            code:2,
            msg:'RefreshToken错误'
        });
    }
});

module.exports=router;